<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.9/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" href="./../lib/layui/css/layui.css">
    <style>
        .layui-table-cell .layui-form-checkbox[lay-skin=primary]{
			top: 5px;
		}
	</style>
    <!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>报表</title>
</head>

<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 营收管理 <span
            class="c-gray en">&gt;</span>
        报表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
            title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
            <div>
                    开始时间：
                    <input type="text"  style="width:200px;margin-right:10px;" name="date" id="date" lay-verify="date"  placeholder="yyyy-MM-dd" autocomplete="off" class="input-text">
                    结束时间：
                    <input type="text"  style="width:200px" name="enDate" id="enDate" lay-verify="date"  placeholder="yyyy-MM-dd" autocomplete="off" class="input-text">
                    <button type="submit" class="btn btn-success" name="" data-type="reload" id="search"><i class="Hui-iconfont">&#xe665;</i>
                        搜索</button>
                </div>

        <table class="layui-hide" id="revenueList" lay-filter="revenueList"></table>
    </div>
    <input type="" name="details_id" id="details_id" value="" style="display:none;" />
    <script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="./../static/js/common.js"></script>
    <script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script>
    <script type="text/javascript" src="./../lib/layui/layui.js"></script>
    <script type="text/html" id="toolbar">
        <!-- <div class="layui-btn-container" >
            <button class="layui-btn layui-btn-sm" lay-event="getCheckData">  <i class="Hui-iconfont">&#xe644;</i> 导出</button>
          </div> -->
        <!-- <div class="layui-btn-container" >
                <span style="font-size:18px">导出</span>
        </div> -->
      </script>
    <script>
        layui.use(['table','laydate'], function () {
            var table = layui.table,
                laydate = layui.laydate;
                 //日期时间选择器
            laydate.render({
                elem: '#date'
            });
            laydate.render({
                elem: '#enDate'
            });
         var insTable = table.render({
                elem: '#revenueList',
                toolbar: '#toolbar',
                // defaultToolbar: [],
                cellMinWidth: 120,
                url:admin_url + '/statistical/report',
                id: 'reload',
                page: 'true',
                request: {
                    pageName: 'page',
                    limitName: 'size'
                },
                paresData: function (res) {
                    return {
                        'data': res.data
                    }
                },
                response: {
                    statusCode: 200
                },
                where: {
                    tokenUserId: userId,
                    token: token
                },
                // // 回调
                done: function (res, curr, count) {
                },
                method: 'post',
                cols: [[
                    { field: 'time', title: '日期', align: 'center',width:180, templet:function(obj){
                        return '<span title="' + obj.time + '">' + obj.time + '</span>'
                    } },
                    { field: 'shoping', title: '购物', align: 'center' },
                    { field: 'mdRecharge', title: '美豆充值', align: 'center' },
                    { field: 'wxRecharge', title: '微信充值', align: 'center' },
                    { field: 'zfbRecharge', title: '支付宝充值', align: 'center' },
                    { field: 'cas', title: '提现', align: 'center' },
                    { field: 'giftBoxReturn', title: '礼包返利', align: 'center' },
                    { field: 'giftBoxBonus', title: '礼包分红', align: 'center' },
                    { field: 'productNormalReturn', title: '商品返利', align: 'center' },
                    { field: 'productBonus', title: '商品分红', align: 'center' },
                    { field: 'refund', title: '退还', align: 'center' },
                    { field: 'productRobReturn', title: '抢购商品返利', align: 'center' },
                    { field: 'productHotReturn', title: '热销商品返利', align: 'center' },
                    { field: 'tdGiftBoxReturn', title: '团队礼包返利', align: 'center' },
                    { field: 'tdProductBonus', title: '团队重销返利', align: 'center'},
                ]]
            })
                // 搜索功能
                $('#search').on('click', function () {
                var date = $("#date").val(),
                    enDate = $("#enDate").val();
                insTable.reload({
                    where: {
                        "token": token,
                        "tokenUserId": userId,
                        'startDate':date,
                        'endDate':enDate
                    }, page: {
                        curr: 1
                    }
                });
            });
        })
    </script>
</body>

</html>